<?php
    include './public/db_object.php';

    if(isset($_POST)){
        $goods = $_POST['category'];

        $sql = "select * from t_goods where cid=$goods";
        $db = new DB_object(['db_name'=>'db_shop']);

        $res = $db->l_select_all($sql);
        if($res){
            echo json_encode(array('error' => 1, 'data'=>$res));
        }else{
            echo json_encode(array('error' => 0));
        }
    }

?>